home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
B-Business
/
(c)b3.d64
/
lottery nums.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2008-11-26
|
1KB
|
28 lines
10 REM LOTTERY NUMBER GENERATOR BY P. SPEAGLE
20 POKE53281,10:POKE53280,10:PRINT"[147]"
30 PRINT" LOTTERY NUMBER GENERATOR":PRINTTAB(12)"BY PAUL SPEAGLE"
40 PRINT"THIS PROGRAM GENERATES A SERIES OF "
50 PRINT"RANDOM NUMBERS WHICH MAY BE USED TO GET A RANDOM NUMBER FOR A LOTTERY";
55 PRINT" TICKET"
60 PRINT"AS SET UP THE PROGRAM WILL GENERATE A":PRINT"SEQUENCE OF SIX RANDOM NUMBERS";
70 PRINT" FOR ":PRINT"THE LOTO 6/49 LOTTERY."
75 PRINT"TO CUSTOMIZE, EDIT LINES 100 - 120"
80 PRINTTAB(9)"PRESS ANY KEY TO START"
85 GETA$:IFA$=""THEN85
100 REM LOTO 6/49
105 NUM = 6 :REM HOW MANY NUMBERS ARE MUST BE GENERATED AT ONCE ?
110 MIN = 1 : REM MINIMUM VALUE THAT EACH NUMBER MAY TAKE
115 MAX = 49 : REM MAXIMUM VALUE THAT A NUMBER MAY TAKE ON
130 DIM NUM%(NUM)
140 NUM%(1)=INT(RND(TI)):REM ENSURE THAT A NEW RANDOM SEQUENCE IS GENERATED
141 REM EACH TIME THAT THE PROGRAM IS RUN
150 FORI=1 TO NUM
160 NUM%(I)=INT(RND(1)*MAX)+MIN
170 NEXTI
200 PRINT"[147]HERE ARE";NUM;"RANDOM NUMBERS"
220 FORI=1TONUM:PRINTNUM%(I);" ";:NEXT:PRINT:PRINT
240 PRINT"HIT Q TO QUIT OR ANY OTHER KEY TO":PRINT"GENERATE ANOTHER SET OF NUMBERS."
250 GETA$:IFA$=""THEN250
260 IF A$<>"Q"THEN150
270 END